<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>single_nubot_gazebo: src/nubot_common/core/include/nubot/core/Circle.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">single_nubot_gazebo
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_93262b1c7483f4ea8c70e946e7488dda.html">src</a></li><li class="navelem"><a class="el" href="dir_b89c572576b5836e921eba814157f82a.html">nubot_common</a></li><li class="navelem"><a class="el" href="dir_bc336a74354ab03ae1a066564339fe6a.html">core</a></li><li class="navelem"><a class="el" href="dir_b079fcacf30cb25eef8fa3a3ed6b781d.html">include</a></li><li class="navelem"><a class="el" href="dir_effbbc41f85462a3db372dff6a4e60c7.html">nubot</a></li><li class="navelem"><a class="el" href="dir_52eb59d5964670d54dcc5c2dd269722d.html">core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Circle.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Circle_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __NUBOT_CORE_CIRCLE_HPP__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __NUBOT_CORE_CIRCLE_HPP__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Line_8hpp.html">Line.hpp</a>&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">namespace </span>nubot</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;{</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keyword">using</span> std::vector;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="classnubot_1_1Circle.html">Circle</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <span class="comment">// various constructors</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle</a>();</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle</a>(<span class="keywordtype">double</span> _radius, <span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; _center);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Circle.html">Circle</a> &amp; _circle);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt;  <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt1, <span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt2);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a221e2537db4f65da3462eca1374070d0">inside</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a27c663258243e156860092eb648e6eb1">onedge</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    std::vector&lt; DPoint_&lt;double&gt; &gt; <a class="code" href="classnubot_1_1Circle.html#a0f636f2fa233c4ea91c2bf76a5357e85">crosspoint</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; std::vector&lt; DPoint_&lt;double&gt; &gt; <a class="code" href="classnubot_1_1Circle.html#ae30b8af217855017e72b6ad27d97e0d8">tangentpoint</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#aaa9f7ac0951e42a9daf093e0b6b04a35">isIntersect</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a42df665db5104645c7c7cbd509110553">isContact</a> (<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line)  <span class="keyword">const</span>;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a86f0a0b3c09e8d4f0a63d7211b99c43f">isSeparate</a> (<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">   37</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>;          <span class="comment">//&lt;radius of circle</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">   38</a></span>&#160;    <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;double&gt;</a> <a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>; <span class="comment">//&lt;center of circle</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;};</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">   43</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle::Circle</a>() : radius_(0.0),center_(<a class="code" href="classnubot_1_1DPoint__.html">DPoint_</a>&lt;double&gt;(0.0,0.0)) {};</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a7b9e93757d174a530119510ea4f5f09f">   44</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keyword">inline</span> <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle::Circle</a>(<span class="keywordtype">double</span> _radius, <span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; _center) : radius_(_radius),center_(_center)  {};</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#aee5aa88389a236d017bc42dff3bc5b4f">   45</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle::Circle</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Circle.html">Circle</a> &amp; _circle) : radius_(_circle.radius_),center_(_circle.center_) {};</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a575a6adbfd11e44614c53e4db663d2fc">   46</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keyword">inline</span> <a class="code" href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">Circle::Circle</a>( <span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt1, <span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt2)</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>=pt1.<a class="code" href="classnubot_1_1DPoint__.html#aaeee628e925a80b8fc2147d14c5ca7e4">distance</a>(pt2)/2.0;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>=(<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt1)+<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt2))*(1/2.0);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;}</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a221e2537db4f65da3462eca1374070d0">   51</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a221e2537db4f65da3462eca1374070d0">Circle::inside</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt)<span class="keyword"> const</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">return</span>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>.<a class="code" href="classnubot_1_1DPoint__.html#aaeee628e925a80b8fc2147d14c5ca7e4">distance</a>(pt)&lt;<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;}</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a27c663258243e156860092eb648e6eb1">   55</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a27c663258243e156860092eb648e6eb1">Circle::onedge</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt)<span class="keyword"> const</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordflow">return</span>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>.<a class="code" href="classnubot_1_1DPoint__.html#aaeee628e925a80b8fc2147d14c5ca7e4">distance</a>(pt)==<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#aaa9f7ac0951e42a9daf093e0b6b04a35">   59</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#aaa9f7ac0951e42a9daf093e0b6b04a35">Circle:: isIntersect</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line)<span class="keyword"> const</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordflow">return</span> (line.<a class="code" href="classnubot_1_1Line__.html#a2922d374fef598bcc7d12a74a7923e92">distance</a>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>)&lt;<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a42df665db5104645c7c7cbd509110553">   63</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a42df665db5104645c7c7cbd509110553">Circle:: isContact</a> (<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line)<span class="keyword"> const</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">return</span> (line.<a class="code" href="classnubot_1_1Line__.html#a2922d374fef598bcc7d12a74a7923e92">distance</a>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>)==<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;}</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a86f0a0b3c09e8d4f0a63d7211b99c43f">   67</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classnubot_1_1Circle.html#a86f0a0b3c09e8d4f0a63d7211b99c43f">Circle:: isSeparate</a> (<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line)<span class="keyword"> const</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keywordflow">return</span> (line.<a class="code" href="classnubot_1_1Line__.html#a2922d374fef598bcc7d12a74a7923e92">distance</a>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>)&gt;<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;}</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#a0f636f2fa233c4ea91c2bf76a5357e85">   73</a></span>&#160;<span class="keyword">inline</span> std::vector&lt; DPoint_&lt;double&gt; &gt; <a class="code" href="classnubot_1_1Circle.html#a0f636f2fa233c4ea91c2bf76a5357e85">Circle::crosspoint</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1Line__.html">Line_</a> &amp; line)<span class="keyword"> const</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    vector&lt; DPoint_&lt;double&gt; &gt; cross_point;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    cross_point.reserve(2);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">double</span>  disLine=line.<a class="code" href="classnubot_1_1Line__.html#a2922d374fef598bcc7d12a74a7923e92">distance</a>(<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">if</span>(disLine&lt;=<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>)</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;     {</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="keywordflow">if</span>(disLine&lt;<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>) </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                <a class="code" href="classnubot_1_1DPoint__.html">DPoint2d</a> pt=<a class="code" href="namespacenubot.html#a3ef23abce325d44c7509330711f673f2">verticalpoint</a>(line,<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordtype">double</span> tmpdis=<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt-<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>).<a class="code" href="classnubot_1_1DPoint__.html#adbeafad257d68a7ec2bba4d11640fa3a">norm</a>();</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="keywordtype">double</span> dis=sqrt(<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>*<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>-tmpdis*tmpdis);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        cross_point.push_back(<a class="code" href="namespacenubot.html#a822e3dc5ebbc620d8478f5cc78ed8665">pointinline</a>(line,pt,dis));</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        cross_point.push_back(<a class="code" href="namespacenubot.html#a822e3dc5ebbc620d8478f5cc78ed8665">pointinline</a>(line,pt,-dis)); </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;           cross_point.push_back(<a class="code" href="namespacenubot.html#a3ef23abce325d44c7509330711f673f2">verticalpoint</a>(line,<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>)); </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;     }      </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordflow">return</span> cross_point;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;}</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classnubot_1_1Circle.html#ae30b8af217855017e72b6ad27d97e0d8">   95</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Tp&gt; <span class="keyword">inline</span> std::vector&lt; DPoint_&lt;double&gt; &gt; <a class="code" href="classnubot_1_1Circle.html#ae30b8af217855017e72b6ad27d97e0d8">Circle::tangentpoint</a>(<span class="keyword">const</span> <a class="code" href="classnubot_1_1DPoint__.html">DPoint_&lt;_Tp&gt;</a> &amp; pt)<span class="keyword"> const</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    vector&lt; DPoint_&lt;double&gt; &gt; tangent_point;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordtype">double</span> dispt=<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>.<a class="code" href="classnubot_1_1DPoint__.html#aaeee628e925a80b8fc2147d14c5ca7e4">distance</a>(pt);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordflow">if</span>(dispt&gt;=<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>)</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    {</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="keywordflow">if</span>(dispt&gt;<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>)</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        {       </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;            <a class="code" href="classnubot_1_1DPoint__.html">DPoint2d</a> Vect=<a class="code" href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">center_</a>-<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                <a class="code" href="classnubot_1_1Angle.html">Angle</a> theta=Vect.<a class="code" href="classnubot_1_1DPoint__.html#a0eb2d9ad77c094e92b7bf4b3cf08eaa2">angle</a>();</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                <a class="code" href="classnubot_1_1Angle.html">Angle</a> theta_e=<a class="code" href="classnubot_1_1Angle.html">Angle</a>(asin(<a class="code" href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">radius_</a>/dispt));</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                <span class="keywordtype">double</span> dis=dispt*cos(theta_e.<a class="code" href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">radian_</a>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <a class="code" href="classnubot_1_1Angle.html">Angle</a> tmp=theta+theta_e;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            tangent_point.push_back(<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt)+<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(dis*cos(tmp.<a class="code" href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">radian_</a>),dis*sin(tmp.<a class="code" href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">radian_</a>)));  </div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            tmp = theta-theta_e;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            tangent_point.push_back(<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt)+<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(dis*cos(tmp.<a class="code" href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">radian_</a>),dis*sin(tmp.<a class="code" href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">radian_</a>)));</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        }</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;           tangent_point.push_back(<a class="code" href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">DPoint2d</a>(pt)); </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="keywordflow">return</span> tangent_point;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;}</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;}</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="ttc" id="classnubot_1_1Circle_html_a86f0a0b3c09e8d4f0a63d7211b99c43f"><div class="ttname"><a href="classnubot_1_1Circle.html#a86f0a0b3c09e8d4f0a63d7211b99c43f">nubot::Circle::isSeparate</a></div><div class="ttdeci">bool isSeparate(const Line_ &amp;line) const </div><div class="ttdef"><b>Definition:</b> Circle.hpp:67</div></div>
<div class="ttc" id="classnubot_1_1Line___html_a2922d374fef598bcc7d12a74a7923e92"><div class="ttname"><a href="classnubot_1_1Line__.html#a2922d374fef598bcc7d12a74a7923e92">nubot::Line_::distance</a></div><div class="ttdeci">double distance(const DPoint_&lt; _Tp &gt; &amp;pt) const </div><div class="ttdoc">the distance between a point and a line; </div><div class="ttdef"><b>Definition:</b> Line.hpp:121</div></div>
<div class="ttc" id="classnubot_1_1Line___html"><div class="ttname"><a href="classnubot_1_1Line__.html">nubot::Line_</a></div><div class="ttdef"><b>Definition:</b> Line.hpp:10</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a221e2537db4f65da3462eca1374070d0"><div class="ttname"><a href="classnubot_1_1Circle.html#a221e2537db4f65da3462eca1374070d0">nubot::Circle::inside</a></div><div class="ttdeci">bool inside(const DPoint_&lt; _Tp &gt; &amp;pt) const </div><div class="ttdoc">whether the point is in the circle </div><div class="ttdef"><b>Definition:</b> Circle.hpp:51</div></div>
<div class="ttc" id="classnubot_1_1DPoint___html"><div class="ttname"><a href="classnubot_1_1DPoint__.html">nubot::DPoint_</a></div><div class="ttdef"><b>Definition:</b> DPoint.hpp:11</div></div>
<div class="ttc" id="classnubot_1_1DPoint___html_adbeafad257d68a7ec2bba4d11640fa3a"><div class="ttname"><a href="classnubot_1_1DPoint__.html#adbeafad257d68a7ec2bba4d11640fa3a">nubot::DPoint_::norm</a></div><div class="ttdeci">double norm() const </div><div class="ttdoc">value of norm; </div><div class="ttdef"><b>Definition:</b> DPoint.hpp:98</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_ae30b8af217855017e72b6ad27d97e0d8"><div class="ttname"><a href="classnubot_1_1Circle.html#ae30b8af217855017e72b6ad27d97e0d8">nubot::Circle::tangentpoint</a></div><div class="ttdeci">std::vector&lt; DPoint_&lt; double &gt; &gt; tangentpoint(const DPoint_&lt; _Tp &gt; &amp;pt) const </div><div class="ttdoc">tangent point of circle and tangential line pass through pt and tangent point </div><div class="ttdef"><b>Definition:</b> Circle.hpp:95</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_aa65fe4a79dff4f07f6d024fa55edb6aa"><div class="ttname"><a href="classnubot_1_1Circle.html#aa65fe4a79dff4f07f6d024fa55edb6aa">nubot::Circle::center_</a></div><div class="ttdeci">DPoint_&lt; double &gt; center_</div><div class="ttdef"><b>Definition:</b> Circle.hpp:38</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a27c663258243e156860092eb648e6eb1"><div class="ttname"><a href="classnubot_1_1Circle.html#a27c663258243e156860092eb648e6eb1">nubot::Circle::onedge</a></div><div class="ttdeci">bool onedge(const DPoint_&lt; _Tp &gt; &amp;pt) const </div><div class="ttdoc">whether the point is on the circle </div><div class="ttdef"><b>Definition:</b> Circle.hpp:55</div></div>
<div class="ttc" id="classnubot_1_1Angle_html"><div class="ttname"><a href="classnubot_1_1Angle.html">nubot::Angle</a></div><div class="ttdef"><b>Definition:</b> Angle.hpp:15</div></div>
<div class="ttc" id="classnubot_1_1Circle_html"><div class="ttname"><a href="classnubot_1_1Circle.html">nubot::Circle</a></div><div class="ttdef"><b>Definition:</b> Circle.hpp:12</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a42df665db5104645c7c7cbd509110553"><div class="ttname"><a href="classnubot_1_1Circle.html#a42df665db5104645c7c7cbd509110553">nubot::Circle::isContact</a></div><div class="ttdeci">bool isContact(const Line_ &amp;line) const </div><div class="ttdef"><b>Definition:</b> Circle.hpp:63</div></div>
<div class="ttc" id="Line_8hpp_html"><div class="ttname"><a href="Line_8hpp.html">Line.hpp</a></div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a0f636f2fa233c4ea91c2bf76a5357e85"><div class="ttname"><a href="classnubot_1_1Circle.html#a0f636f2fa233c4ea91c2bf76a5357e85">nubot::Circle::crosspoint</a></div><div class="ttdeci">std::vector&lt; DPoint_&lt; double &gt; &gt; crosspoint(const Line_ &amp;line) const </div><div class="ttdoc">crossing point between line and circle </div><div class="ttdef"><b>Definition:</b> Circle.hpp:73</div></div>
<div class="ttc" id="classnubot_1_1DPoint___html_aaeee628e925a80b8fc2147d14c5ca7e4"><div class="ttname"><a href="classnubot_1_1DPoint__.html#aaeee628e925a80b8fc2147d14c5ca7e4">nubot::DPoint_::distance</a></div><div class="ttdeci">double distance(const DPoint_&lt; _Tp2 &gt; &amp;pt) const </div><div class="ttdoc">distance between (x_,y_) and pt </div><div class="ttdef"><b>Definition:</b> DPoint.hpp:86</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a6fcb5d5835ad8c86696ce21948609270"><div class="ttname"><a href="classnubot_1_1Circle.html#a6fcb5d5835ad8c86696ce21948609270">nubot::Circle::Circle</a></div><div class="ttdeci">Circle()</div><div class="ttdef"><b>Definition:</b> Circle.hpp:43</div></div>
<div class="ttc" id="namespacenubot_html_a822e3dc5ebbc620d8478f5cc78ed8665"><div class="ttname"><a href="namespacenubot.html#a822e3dc5ebbc620d8478f5cc78ed8665">nubot::pointinline</a></div><div class="ttdeci">static DPoint_&lt; _Tp &gt; pointinline(const Line_ &amp;line, const DPoint_&lt; _Tp &gt; &amp;pt, double dis)</div><div class="ttdoc">get the point which has the dis with pt in line </div><div class="ttdef"><b>Definition:</b> Line.hpp:162</div></div>
<div class="ttc" id="classnubot_1_1DPoint___html_a0eb2d9ad77c094e92b7bf4b3cf08eaa2"><div class="ttname"><a href="classnubot_1_1DPoint__.html#a0eb2d9ad77c094e92b7bf4b3cf08eaa2">nubot::DPoint_::angle</a></div><div class="ttdeci">Angle angle() const </div><div class="ttdoc">angle of (y_,x_) </div><div class="ttdef"><b>Definition:</b> DPoint.hpp:102</div></div>
<div class="ttc" id="namespacenubot_html_ab9fab4518d012a39668ef9243a79592d"><div class="ttname"><a href="namespacenubot.html#ab9fab4518d012a39668ef9243a79592d">nubot::DPoint2d</a></div><div class="ttdeci">DPoint_&lt; double &gt; DPoint2d</div><div class="ttdef"><b>Definition:</b> DPoint.hpp:53</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_a64d442408c8cb47a97c31017976722bb"><div class="ttname"><a href="classnubot_1_1Circle.html#a64d442408c8cb47a97c31017976722bb">nubot::Circle::radius_</a></div><div class="ttdeci">double radius_</div><div class="ttdef"><b>Definition:</b> Circle.hpp:37</div></div>
<div class="ttc" id="namespacenubot_html_a3ef23abce325d44c7509330711f673f2"><div class="ttname"><a href="namespacenubot.html#a3ef23abce325d44c7509330711f673f2">nubot::verticalpoint</a></div><div class="ttdeci">static DPoint_&lt; _Tp &gt; verticalpoint(const Line_ &amp;line, const DPoint_&lt; _Tp &gt; &amp;pt)</div><div class="ttdef"><b>Definition:</b> Line.hpp:171</div></div>
<div class="ttc" id="classnubot_1_1Angle_html_a27c50c2b15dd1231c0162c13848f7b9e"><div class="ttname"><a href="classnubot_1_1Angle.html#a27c50c2b15dd1231c0162c13848f7b9e">nubot::Angle::radian_</a></div><div class="ttdeci">double radian_</div><div class="ttdef"><b>Definition:</b> Angle.hpp:34</div></div>
<div class="ttc" id="classnubot_1_1Circle_html_aaa9f7ac0951e42a9daf093e0b6b04a35"><div class="ttname"><a href="classnubot_1_1Circle.html#aaa9f7ac0951e42a9daf093e0b6b04a35">nubot::Circle::isIntersect</a></div><div class="ttdeci">bool isIntersect(const Line_ &amp;line) const </div><div class="ttdoc">the relationship between Line and Circle; </div><div class="ttdef"><b>Definition:</b> Circle.hpp:59</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jul 30 2016 00:26:42 for single_nubot_gazebo by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
